/* ===========================================================
			Resonance
	NPC Name: 		Kia
	Map(s): 		Queen's Path: Forest of the Start 5(130030005)
	Description: 	Quest - A box With An Item Inside
=============================================================
Version 1.0 - Script Done.(16/6/2010)
=============================================================
*/

var status = -1;

function start(mode, type, selection) {
    status++;
	if (mode != 1) {
	    if(type == 1 && mode == 0)
		    status -= 2;
		else{
			qm.sendNext("Hmmm... is that too difficult for you? Is that because you're not sure how to open a box? I'll teach you how to do it if you accept this quest, so think about it.");
			qm.dispose();
			return;
		}
	}
	if(status == 0)
		qm.sendNext("#b(Knock knock knock knock...)#k");
	if(status == 1)
		qm.sendNextPrev("Whoa, you surprised me! I was so into this work that I didn't even notice that you came in. Are you the Nobless that #p1102006# was talking about? Hey, nice to meet you! I'm #p1102007#, and I specialize in making #bchairs#k. I'm thinking of building you one as well as our way of saying welcome to Erev.");
	if(status == 2)
		qm.sendNextPrev("The problem is...I am a bit short on materials to build the chair, and I'd like for you to gather up the materials for me. You'll notice that there are plenty of boxes lying around the area. Break those boxes and you'll find #t4032267# and #t4032268#. Your job is to bring them both.");
	if(status == 3)
		qm.sendNextPrev("Do you know how to open a box? The box can be opened simply by swinging the weapon at it as if you're hunting a monster. A reminder, though. You may attack monsters with special skills, but #byou may ONLY open boxes by using regular attacks#k.");
	if(status == 4)
		qm.sendAcceptDecline("I want you to open the boxes and get me one #b#t4032267##k and one #b#t4032268##k! Once you gather up the materials, I'll do the rest and build you an awesome chair. I'll be here waiting!");
	if(status == 5){
		qm.forceStartQuest();
		qm.displayGuide(9);
		qm.dispose();
		}
	}
	
function end(mode, type, selection) {
    status++;
	if (mode != 1) {
	    if(type == 1 && mode == 0)
		    status -= 2;
		else{
		    qm.dispose();
			return;
		}
	}
	if(status == 0)
		qm.sendNext("So did you bring the building stone and the insignia? Let's see...oh this is it! These are the materials I need to build a chair! Good one there! Now give me some time as I build this for you...");
	if(status == 1)
		qm.sendNextPrev("Here it is, the #t3010060#. Isn't it great? Remember that #bwhen you sit on the chair while you're tired or not in great shape, your HP will recover faster than if you're just standing still#k. You'll find it at the #bsetup inventory#k, so check it first before going to see #b#p1102008##k. Just follow the arrow to the left.\r\n\r\n#fUI/UIWindow.img/QuestIcon/4/0# \r\n#i3010060# 1 #t3010060# \r\n#fUI/UIWindow.img/QuestIcon/8/0# 95 exp");
	if(status == 2){
		qm.forceCompleteQuest();
		qm.gainItem(4032267, -1);
		qm.gainItem(4032268, -1);
		qm.gainItem(3010060, 1);
		qm.gainExp(95);
		qm.displayGuide(10);
		qm.dispose();
	}
}
		